/**
 * 
 */
package com.qb.mobile.model;

import java.io.Serializable;

/**
 * @author <a href="mailto:dangcongthanhtrung@gmail.com">dangtrung</a>
 * 
 *         Address.java class
 * 
 */
public class Address implements Serializable {

	private static final long serialVersionUID = -2996751565644749687L;

	private String poBox;
	private String street;
	private String city;
	private String state;
	private String postalCode;
	private String country;
	private String type;
	private String asString = "";

	public Address(String asString, String type) {
		this.asString = asString;
		this.type = type;
	}

	public Address(String poBox, String street, String city, String state,
			String postalCode, String country, String type) {
		super();
		this.poBox = poBox;
		this.street = street;
		this.city = city;
		this.state = state;
		this.postalCode = postalCode;
		this.country = country;
		this.type = type;
	}

	public String toString() {
		if (this.asString.length() > 0) {
			return (this.asString);
		} else {
			String addr = "";
			if (this.getPoBox() != null) {
				addr = addr + this.getPoBox() + "n";
			}
			if (this.getStreet() != null) {
				addr = addr + this.getStreet() + "n";
			}
			if (this.getCity() != null) {
				addr = addr + this.getCity() + ", ";
			}
			if (this.getState() != null) {
				addr = addr + this.getState() + " ";
			}
			if (this.getPostalCode() != null) {
				addr = addr + this.getPostalCode() + " ";
			}
			if (this.getCountry() != null) {
				addr = addr + this.getCountry();
			}
			return (addr);
		}
	}

	/**
	 * @return the poBox
	 */
	public String getPoBox() {
		return poBox;
	}

	/**
	 * @param poBox
	 *            the poBox to set
	 */
	public void setPoBox(String poBox) {
		this.poBox = poBox;
	}

	/**
	 * @return the street
	 */
	public String getStreet() {
		return street;
	}

	/**
	 * @param street
	 *            the street to set
	 */
	public void setStreet(String street) {
		this.street = street;
	}

	/**
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * @param city
	 *            the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @return the postalCode
	 */
	public String getPostalCode() {
		return postalCode;
	}

	/**
	 * @param postalCode
	 *            the postalCode to set
	 */
	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	/**
	 * @return the country
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * @param country
	 *            the country to set
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

}
